import java.util.Scanner;

public class Main1428 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        int max=arr[0],p=0;
        for(int i=1;i<arr.length;i++) {
            if(max<arr[i]) {
                max=arr[i];
                p=i;
            }
        }
        int min=arr[0],q=0;
        for(int i=1;i<arr.length;i++) {
            if(min>arr[i]) {
                min=arr[i];
                q=i;
            }
        }

        System.out.print((p+1)+" "); System.out.print((q+1));
    }
}

